<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /*执行范围为小于等于839px */
        @media screen and (max-width: 839px) {
           body {
               background-color: chartreuse;
           }
        }
        /* 利用层叠性使执行范围为大于等于840px-小于等于1139px */
        @media screen and (min-width: 840px) {
            body {
                background-color: crimson;
            }
        }
        /* 执行范围为大于等于1140px */
        @media screen and (min-width: 1140px) {
            body {
                background-color: darkorange;
            }
        }
    </style>
</head>
<body>
    
</body>
</html>